<?php

namespace App\Params\Backend;

use App\Params\Param;
/**
 * 客户列表查询参数
 *
 * @author: WangBin
 * @date: 2021/7/26
 * @mail: <849850352@qq.com>
 */
class CustomerListParams extends Param
{
    public $nickname;
    public $mobile;
    public $page_size = 20;
    public $page = 1;
    public $gender;
    public $group_id;
    public $grade_id;
    public $is_active;

    public function rules()
    {
        return [
            'nickname' => 'nullable|string',
            'mobile' => 'nullable|string',
            'gender' => 'nullable|string',
            'group_id' => 'nullable|integer',
            'grade_id' => 'nullable|integer',
            'page_size' => 'nullable|integer',
            'page' => 'nullable|integer',
            'is_active' => 'nullable|integer'
        ];
    }

    /**
     * @return mixed
     */
    public function getNickname()
    {
        return $this->nickname;
    }

    /**
     * @param mixed $nickname
     */
    public function setNickname($nickname): void
    {
        $this->nickname = $nickname;
    }

    /**
     * @return mixed
     */
    public function getMobile()
    {
        return $this->mobile;
    }

    /**
     * @param mixed $mobile
     */
    public function setMobile($mobile): void
    {
        $this->mobile = $mobile;
    }

    /**
     * @return int
     */
    public function getPageSize(): int
    {
        return $this->page_size;
    }

    /**
     * @param int $page_size
     */
    public function setPageSize(int $page_size): void
    {
        $this->page_size = $page_size;
    }

    /**
     * @return int
     */
    public function getPage(): int
    {
        return $this->page ? -- $this->page : 0;
    }

    /**
     * @param int $page
     */
    public function setPage(int $page): void
    {
        $this->page = $page;
    }

    /**
     * @return mixed
     */
    public function getGender()
    {
        return $this->gender;
    }

    /**
     * @param mixed $gender
     */
    public function setGender($gender): void
    {
        $this->gender = $gender;
    }

    /**
     * @return mixed
     */
    public function getGroupId()
    {
        return $this->group_id;
    }

    /**
     * @param mixed $group_id
     */
    public function setGroupId($group_id): void
    {
        $this->group_id = $group_id;
    }

    /**
     * @return mixed
     */
    public function getGradeId()
    {
        return $this->grade_id;
    }

    /**
     * @param mixed $grade_id
     */
    public function setGradeId($grade_id): void
    {
        $this->grade_id = $grade_id;
    }

    /**
     * @return mixed
     */
    public function getIsActive()
    {
        return $this->is_active;
    }

    /**
     * @param mixed $is_active
     */
    public function setIsActive($is_active): void
    {
        $this->is_active = $is_active;
    }
}
